<% if @basic_auth.present? || @feeds.present?%>
  window.dispatchEvent(new CustomEvent("add-feed:updateContent", {
    detail: {
      data: "<%= j render Dialog::AddFeed::ResultsData.new(query: @query, feeds: @feeds, tag_editor: @tag_editor, search: @search, basic_auth: @basic_auth, auth_attempted: @auth_attempted, subscriptions: @subscriptions) %>"
    }
  }))

  if (window.location.pathname === "/" && window.location.search.length !== 0) {
    window.history.replaceState({}, document.title, "/");
  }
<% else %>
  window.dispatchEvent(new CustomEvent("add-feed:clearResults", {detail: {error: true}}))
  feedbin.showNotification('No feed found.', true);
<% end %>
